<div class="panel panel-default panel-intro">

    <div class="panel-heading">
        {:__('Info')}
    </div>
    <div class="panel-body newrow">
        <form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="" onsubmit="return true">

            <div class="row">
                <div class="col-md-4 col-xs-12 form-group">
                    <label class="control-label col-xs-12 col-sm-3">{:__('Code')}:</label>
                    <div class="col-xs-12 col-sm-6">
                        <input id="c-code" class="form-control" name="row[code]" type="text">
                    </div>
                </div>
                <div class="col-md-4 col-xs-12 form-group">
                    <label class="control-label col-xs-12 col-sm-3">{:__('Supplier')}:</label>
                    <div class="col-xs-12 col-sm-6">
                        <input   id="c-supplier" class="form-control" type="text"  data-toggle="modal" >
                        <input  id="c-supId" class="form-control" name="row[supplier_id]" style="display: none;" type="text"  data-toggle="modal" data-target="#myModal">
                    </div>
                </div>
                <div class="col-md-4 col-xs-12 form-group">

                    <div class="form-inline" data-toggle="cxselect" data-selects="first,second">
                        <label class="control-label col-xs-12 col-sm-3">{:__('Warehouse')}:</label>
                        <div class="col-xs-12 col-sm-9">
                            <select id="hose-fist" class="first form-control" date-rule="required;"  name="row[warehouse_id]" data-url="ykjp/purchase/addorder/getWarehouse?type=page" style="width: 35%">
                                <option value="2" selected="">新建</option>
                            </select>
                        </div>

                    </div>
                </div>
                <div class="col-md-4 col-xs-12 form-group">
                    <label class="control-label col-xs-12 col-sm-3">{:__('Billing')}:</label>
                    <div class="col-xs-12 col-sm-6">
                        <input id="c-billing_date" data-rule="required;" class="form-control datetimepicker" data-date-format=" YYYY-MM-DD"  name="row[billing_time]" type="text" >
                    </div>
                </div>
            </div>

            <div class="row" style="margin:20px 0">
                <div class="col-md-5 col-xs-12 form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('Remark')}:</label>
                    <div class="col-xs-12 col-sm-6">
                        <textarea id="c-remark" class="form-control " rows="3" name="row[remark]" cols="30"></textarea>
                    </div>
                </div>
            </div>
            <table id="table" class="table table-striped table-bordered table-hover table-nowrap">
                <thead>
                <th>{:__('Serial number')}</th>
                <th>{:__('Sku')}</th>
                <th>{:__('Commodity')}</th>     
                <th>{:__('Specification')}</th>
                <th>{:__('Attributes')}</th>
                <th>{:__('Unit')}</th>
                <th>{:__('Quantity')}</th>
                <th>{:__('unit price')}</th>
                <th>{:__('Subtotal')}</th>
                <th>{:__('Remarks')}</th>
                <th>{:__('Operate')}</th>
                </thead>
                <tbody>
                    <tr>
                        <td class="t-nums"></td>
                        <td class="t-sku"></td>
                        <td><input date-rule="required;"   type="text" name="" data-nums="" data-id="" class="find" class=""  ></td>
                        <td class="guige"></td>
                        <td class="ts" >
                            <!-- <select  style="width: 70%" readonly="readonly"   class="second form-control"  name="row[warehouse_partition_id]"  style="width: 35%">
                           </select> -->
                        </td>
                        <td class="unit"></td>
                        <td><input  type="number" name="" data-rule="required;integer;range(0~);"  class="nums" onblur="totalNums(this)"></td>
                        <td><input  type="number" data-rule="required;" onblur="calMoney(this)" class="unit-price" name=""></td>
                        <td class="subtotal"></td>
                        <td> <textarea rows="2" class="remarks" cols="20"></textarea></td>
                        <td>
                            <button type="button" class="btn btn-primary addrow">{:__('Add')}</button>
                            <button type="button" class="btn btn-default" onclick="delRow(this)">{:__('Delete')}</button>
                        </td>
                    </tr>
                    <tr>
                        <td>{:__('Total')}</td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td class="totalnums" >0 </td>
                        <td></td>
                        <td id="allMoney"></td>
                        <td></td>
                        <td></td>
                    </tr>
                </tbody>
            </table>
            <div>

                <div class="row">
                    <div class="col-md-7 col-xs-12">
                    </div>
                    <div class="col-md-3 col-xs-12">

                    </div>
                    <div class="col-md-2 col-xs-12">
                        {:__('Amounts payable $')}<span id="totalMoney">0.00</span><input id="money" style="display: none;" name="row[money]"  readonly="readonly"  type="" name="">
                        <input id="allNums" style="display: none;" name="row[totalnums]"  readonly="readonly"  type="" name="">
                    </div>
                </div>
            </div>
            <div class="row" style="padding-top:10px;">
                <div class="col-md-10 col-xs-12">
                </div>
                <div class="col-md-2 col-xs-12">
                    <div class="col-xs-12 col-sm-4" >
                    </div>
                    <button type="button" onclick="submitData()" class="btn btn-success btn-embossed">{:__('OK')}</button>
                </div>
            </div>

        </form>

    </div>

</div>

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document" style="width: 700px">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel" >{:__('Select supplier')}</h4>
            </div>
            <div class="modal-body">
                <div id="lays-row" class="row">
                    <table id="table1" class="table table-striped table-bordered table-hover " data-show-export="false" data-show-toggle="false" data-show-columns="false">
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- Modal -->
<div class="modal fade" id="modelProduct" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" >
    <div class="modal-dialog" role="document" style="width: 800px">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">{:__('Select product')}</h4>
            </div>
            <div class="modal-body">
                <div id="lays-row" class="row">
                    <table id="table2" class="table table-striped table-bordered table-hover " data-show-export="false" data-show-toggle="false" data-show-columns="false">
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

